#ifndef CHART_SERVER_H
#define CHART_SERVER_H
#include <muduo/net/TcpServer.h>
#include <muduo/base/Logging.h>
#include <muduo/net/EventLoop.h>

class ChartServer {
public:
    ChartServer(muduo::net::EventLoop* loop, const muduo::net::InetAddress& listenAddr);
    void Start();
    ~ChartServer();
private:
    void OnMessageCb(const muduo::net::TcpConnectionPtr& conn,
        muduo::net::Buffer* buff,
        muduo::Timestamp time
    );
    void OnConnectedCb(const muduo::net::TcpConnectionPtr& conn);
private:
    muduo::net::EventLoop* loop;
    muduo::net::TcpServer server;
};


#endif